package com.xx.ems.system;

import javax.annotation.Resource;

import org.hibernate.Session;
import org.hibernate.SessionFactory;

/**
 * @author xxx
 * @date 2014-2-26
 * @version 1.0
 * 描述: Dao和Service的公共基础类,实现公共的属性、方法
 */
public class BaseDS {
	@Resource
	private SessionFactory sessionFactory;
	
	/**
	 * 描述: 获取sessionFactory对象
	 * @return
	 * @date 2014-2-26
	 */
	public SessionFactory getSessionFactory() {
		return sessionFactory;
	}
	public void setSessionFactory(SessionFactory sessionFactory) {
		this.sessionFactory = sessionFactory;
	}
	/**
	 * 描述: 获取当前session 
	 * @return
	 * @date 2014-2-26
	 */
	public Session getCurrentSession() {
		return getSessionFactory().getCurrentSession();
	}
}